<template>
  <!-- 使用props给子组件传递数据 -->
  <Person a="哈哈" :list="personList" />
</template>

<script setup lang="ts" name="App">
import { reactive } from "vue";
import Person from "./components/Person.vue";
// 引入定义的类型
import { type Persons } from "@/types";

// reactive定义数据时使用泛型限制数据类型
let personList = reactive<Persons>([
  { id: "fdhgjhg01", name: "张三", age: 18 },
  { id: "fdhgjhg02", name: "李四", age: 20 },
  { id: "fdhgjhg03", name: "王五", age: 22 },
]);
</script>
